package com.zhujiekaifa.web;

import com.zhujiekaifa.config.SpringConfigRation;
import com.zhujiekaifa.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserController {
    public static void main(String[] args) {
        //ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("zhujiekaifa.xml");
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfigRation.class);
        UserService userService = (UserService) context.getBean("userService-zj");
        userService.sayHello();

    }
}
